﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TimelineNet.Library;

public partial class LotsOfBands : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if(!Page.IsPostBack) {
            string[] names = Enum.GetNames(typeof(TimelineNet.Library.Enums.TimelineDateTime));
            int max = names.Length - 2;
            Timeline1.Height = (100 * max/2);
            Timeline2.Height = (100 * max/2);
            int x = 0;
            foreach(string t in names) {
                Enums.TimelineDateTime tldt = (Enums.TimelineDateTime)System.Enum.Parse(typeof(Enums.TimelineDateTime), t);
                HotZoneBand band = new HotZoneBand((int)(100 / (max / 2)), tldt, 100);
                band.InitialDate = DateTime.Now;

                if(x > 0 && x!=max/2) band.SynchWith = 0;


                if(x < (max / 2)) {
                    Timeline1.Bands.Add(band);
                } else {
                    Timeline2.Bands.Add(band);
                }
                x++;

                if(x == max) break;
            }
        }
    }
}